﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="GameInterface.aspx.vb" Inherits="LokWebGame.GameInterface" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.signalR-1.0.1.min.js" type="text/javascript"></script>
    <script src="/signalr/hubs" type="text/javascript"></script>
    <script src="Scripts/Game/Game.js"></script>
    <script src="Scripts/Game/Map.js"></script>

<script type="text/javascript">
    $(function () {
        // Proxy created on the fly          
        var chat = $.connection.chatHub;

        // Declare a function on the chat hub so the server can invoke it          
        chat.client.addMessage = function (message) {
            $('#messages').append('<li>' + message + '</li>');
        };

        // Start the connection
        $.connection.hub.start().done(function () {
            $("#broadcast").click(function () {
                // Call the chat method on the server
                chat.server.send($('#msg').val());
            });
        });
    });

    window.onload = function () {
        //Game.initialize();
        //Game.draw();
        Map.Initialize();
        var t = new Tile();
        var myTileIDs = ["2","11"];
        t.Draw(myTileIDs);

       // Game.addPlayer(30, 30);
       // Game._intervalId = setInterval(Game.run, 0);
    };
</script>
</head>
<body>
    <canvas id="GameCanvas" width="400" height="400" style="border:1px solid black;" ></canvas>

    <form id="form1" runat="server">
        <div>
            <input type="text" id="msg" />
            <input type="button" id="broadcast" value="broadcast" />

            <ul id="messages">
            </ul>
        </div>
    </form>
</body>
</html>
